package com.footprint.common.util;

import java.net.URI;

import org.apache.http.client.methods.HttpGet;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.client.methods.HttpPut;
import org.apache.http.client.methods.HttpTrace;
import org.apache.http.client.methods.HttpUriRequest;

public class Constants {

	public enum HttpMethod {
		POST, GET, PUT, DELETE, TRACE
	}

	public static HttpUriRequest initializeHttpRequest( URI uri, Constants.HttpMethod httpMethod ) {
		HttpUriRequest httpRequest = null;
		if (uri != null) {
			if (httpMethod == Constants.HttpMethod.GET) {
				httpRequest = new HttpGet(uri);
			} else if (httpMethod == Constants.HttpMethod.POST) {
				httpRequest = new HttpPost(uri);
			} else if (httpMethod == Constants.HttpMethod.PUT) {
				httpRequest = new HttpPut(uri);
			} else if (httpMethod == Constants.HttpMethod.TRACE) {
				httpRequest = new HttpTrace(uri);
			} else {
				httpRequest = new HttpGet(uri);
			}
		}
		return httpRequest;

	}
}
